Diabetes affects more than 9% of Americans and costs over $245 billion in 2012 in USA. Recently bariatric surgery, such as Roux-en-Y gastric bypass and sleeve gastrectomy, has been proposed for treating diabetic patients with obesity due to its hypoglycemic effect on postprandial blood glucose and significant weight loss. A novel method of intestinal electrical stimulation (IES) is proposed for the treatment of diabetes in this application. In this method, IES is designed to alter gastrointestinal transit and hormones, including incretin hormones, such as glucagon like peptide-1 (GLP-1). Our preliminary studies have demonstrated acceleration of intestinal transit, an increase in postprandial GLP-1 and a reduction in blood glucose after oral glucose. Chronically, the proposed IES has resulted in improvement in glycemic control and improvement in pancreatic islets functions. According to these findings, we hypothesize that the acute hypoglycemic effect of IES in the postprandial state is attributed to IES-induced enhancement in the release of GLP-1 and possibly other hormones as well, such as ghrelin, and that the chronic hypoglycemic effect of IES in both fasting and fed states is attributed to improvement in beta-cell functions, attributed to the prevention of the detrimental effects of hyperglycemia and the ameliorating effect of IES-induced elevated GLP-1 on beta-cell functions. The project will be performed using advanced technologies (wireless stimulation and recording cages, and autonomic and continuous food intake monitoring) that allow IES to be conducted in freely moving animals. The best characterized animal model of spontaneous Type 2 diabetes, the Goto-Kakizaki (GK) rat will be used to accomplish following specific aims: 1) To optimize IES parameters, develop on-demand IES and perform closed-loop IES. First, we will systematically optimized stimulation parameters to maximize the hypoglycemic effect of IES. Then we will develop an algorithm to automatically detect food intake and then trigger IES upon food ingestion. It will be based on characteristics of intrinsic intestinal myoelectrical activity and artificial neural network. The meal triggered IES will avoid excessive stimulation. Finally, a closed-loop IES method (each stimulus is synchronized with intrinsic intestinal myoelectrical activity) will be developed to further increase the efficacy of IES for diabetes. 2) To study the hypoglycemic mechanisms of acute IES involving incretin hormones, such as GLP-1, and ghrelin, and the intestinal transit mechanisms involved in the IES-induced elevation of insulin-stimulating gastrointestinal hormones. 3) To explore cellular mechanisms of chronic IES on long-term glycemic control. Chronic IES will be performed to investigate long-term hypoglycemic effects of IES in both fasting and fed states, and mechanisms involving pancreatic islets functions, beta-cell apoptosis and proliferation, and a number of transcription factors involved in the regulation of ?-cell development, differentiation and function. Possible involvement of L-cells in the distal gut will also be investigated.